package com.bdqn;

import com.bdqn.singleton.CounterSingleton01;

/**
 * 单例模式 饿汉式 线程安全
 */
public class Test06 {

    public static void main(String[] args) {
        CounterSingleton01 counter = CounterSingleton01.getInstance();
        System.out.println(counter.count());
        // 通过单例模式只能获得一个实例
        counter = CounterSingleton01.getInstance();
        System.out.println(counter.count());
    }
}
